﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Runtime.Serialization;
using System.Web;

namespace AgileNYCWebService.Manager.Data.Table
{
	[DataContract]
	public class Comments
	{
		public Comments()
			: this(null)
		{

		}

		public Comments(DataRow row)
		{
			if (row != null)
			{
				if (row.Table.Columns.Contains("Id"))
					Id = row["Id"].GetInteger(-1);
				if (row.Table.Columns.Contains("UserId"))
					UserId = row["UserId"].GetInteger(-1);
				if (row.Table.Columns.Contains("ScheduleId"))
					ScheduleId = row["ScheduleId"].GetInteger(-1);
				if (row.Table.Columns.Contains("PostDate"))
					PostDate = row["PostDate"].GetDateTime(default(DateTime));
			}
		}

		[DataMember]
		public int Id { get; set; }
		[DataMember]
		public int UserId { get; set; }
		[DataMember]
		public int ScheduleId { get; set; }
		[DataMember]
		public DateTime PostDate { get; set; }
	}
}